' C is the right angle
' c is opposite side
' c squared = a squared + b squared

screen _newimage(640, 200, 12)

dim as short a, b, aaa

c = 50 : r = 48

x = 320 : y = 100

again:
    couleur = int(rnd * 64) + 1
    for i = aaa to (49+aaa)
        a = i mod 50
        b = int(   ( (c^2) - ((a mod c)^2) )  ^ (0.5)   )
        if (i mod 6 = 0) then
            circle ( [320 + b], [100 + a]), r, couleur
            circle ( [320 + b], [100 - a]), r, couleur
            circle ( [320 - b], [100 + a]), r, couleur
            circle ( [320 - b], [100 - a]), r, couleur
            circle ( [320 + a], [100 + b]), r, couleur
            circle ( [320 + a], [100 - b]), r, couleur
            circle ( [320 - a], [100 + b]), r, couleur
            circle ( [320 - a], [100 - b]), r, couleur
        end if
        _delay 0.0075
    next a
    aaa = (aaa + 1) mod 50
goto again